﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace WP7iPhone
{
	public partial class AppPageControl : ItemsControl
	{
		public AppPageControl()
		{
			// Required to initialize variables
			InitializeComponent();
		}

        private void DeleteButton_Click(object sender, RoutedEventArgs e)
        {
            FrameworkElement btn = (FrameworkElement)e.OriginalSource;

            UIElement container = ItemContainerGenerator.ContainerFromItem(btn.DataContext) as UIElement;

            WrapPanel parent = (WrapPanel)VisualTreeHelper.GetParent(container);
            parent.Children.Remove(container);
        }
	}

}